//
//  NSString+Frame.m
//  AIChatBox
//
//  Created by Ace Portgas on 2023/6/6.
//

#import "NSString+Frame.h"

@implementation NSString (Frame)
-(CGSize)getSizeWithMaxSize:(CGSize)maxSize andFont:(UIFont *)font{
    return [self boundingRectWithSize:maxSize options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:font} context:nil].size;
}
@end
